package com.chen.staffjoy.account.entity;

import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.time.Instant;

/**
 * 账户信息表
 *
 * @author ChenTian
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@ToString
@DynamicInsert
@DynamicUpdate
@Entity
@Table(name = "account")
public class Account implements Serializable {

    /**
     *
     */
    @Id
    @Column(name = "id")
    private String id;

    /**
     * 邮件
     */
    @Column(name = "email")
    private String email;

    /**
     * 用户名
     */
    @Column(name = "name")
    private String name;

    /**
     * 联系电话
     */
    @Column(name = "phone_number")
    private String phoneNumber;

    /**
     * 账号是否已激活
     */
    @Column(name = "confirmed_and_active")
    private Byte confirmedAndActive;

    /**
     * 创建时间
     */
    @Column(name = "member_since")
    private Instant memberSince;

    /**
     * 密码hash
     */
    @Column(name = "password_hash")
    private String passwordHash;

    /**
     * 头像
     */
    @Column(name = "photo_url")
    private String photoUrl;

    /**
     * 是否是支持用户
     */
    @Column(name = "support")
    private Byte support;

}